package com.sptpc.myalarm;

import android.app.AlarmManager;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.widget.Toast;

public class AlarmReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
//            Intent it = new Intent(this,AlarmMessage.class);
//            it.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//            context.startActivity(it);
        new AlertDialog.Builder(context)
                .setIcon(R.drawable.ic_launcher_background)
                .setTitle("闹钟")
                .setMessage("时间到")
                .setPositiveButton("关闭", null)
                .setNegativeButton("Cancel",null)
                .show();
        Toast.makeText(context,"时间到",Toast.LENGTH_SHORT).show();
    }
}
